<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./js/echarts.min.js"></script>
  </head>
  <body>
    <div id="main" style="width: 800px; height: 1000px"></div>
    <script>
      // 基于准备好的dom，初始化echarts实例
      var myChart = echarts.init(document.querySelector("#main"))
      const data = [
  {
    name: '1万以下',
    value: 20
  },
  {
    name: '1-1.5万',
    value: 50
  },
  {
    name: '1.5万-2万',
    value: 50
  },
  {
    name: '2万以上',
    value: 50
  },
];
option = {
  title: [
    {
      text: '男女生薪资分布',
      left: 'center',
      top:50
    },
    {
      subtext: '男生',
      left: '50%',
      top: '37%',
      textAlign: 'center',
      subtextStyle:{
          fontWeight:700
      }
    },
    {
      subtext: '女生',
      left: '50%',
      top: '68%',
      textAlign: 'center',
      subtextStyle:{
          fontWeight:700
      }

      
    },
  ],
  
  series: [
    {
      type: 'pie',
      // center: ['50%', '50%'],
      radius: ["35%", "50%"],

      data: data,
      label: {
        position: 'outer',
        alignTo: 'none',
        bleedMargin: 5
      },
      left: 'center' ,
      right: '100%',
      top: 35,
      bottom: 500
    },
    {
      type: 'pie',
      radius: ["35%", "50%"],
      // center: ['50%', '50%'],
      data: data,
      label: {
        position: 'outer',
        alignTo: 'none',
        bleedMargin: 5
      },
      left: 'center',
      right: '100%',
      top: 100,
      bottom: 0
    },
  ],
  color: ["#fda224", "#5097ff", "#3fceff", "#34d39a"],
};
      // 使用刚指定的配置项和数据显示图表。
      myChart.setOption(option)
    </script>
  </body>
</html>
